package com.demo.bean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan
public class Config {

    private Player player;

    @Autowired
    private ApplicationContext context;

    @Autowired
    public void setPlayer(Player player) {
        System.out.println("Config setter方法：" + player);
        this.player = player;
    }

    @Bean("customerBean")
    public Customer createCustomer() {
        Customer customer = new Customer();
        customer.setName("郑斯钧");
        return customer;
    }
}
